Skip to content

Translate 'Modifying the document' to Portuguese - #506

Merged
gabifs merged 2 commits into
javascript-tutorial:masterfrom
diogoosz:translate-modifying-document
Nov 22, 2026
Merged

gabifs merged 2 commits into
javascript-tutorial:masterfrom
diogoosz:translate-modifying-document

Conversation

@diogoosz

@diogoosz diogoosz commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Resumo

Traduz o artigo "Modifying the document" para o português, incluindo os 10 exercícios desta pasta. Os SVGs (before-prepend-append-after.svg, insert-adjacent.svg) contêm apenas nomes de métodos e palavras-chave (identificadores de código), por isso ficaram como estão, sem necessidade do pipeline de tradução.

Conforme comentado na #1.

Plano de teste

  • Diff de todos os trechos de código (code spans) entre o original em inglês e a tradução.
  • Grep em busca de falsos cognatos conhecidos e registro informal.
  • Checagem de terminologia contra capítulos irmãos já traduzidos.
  • Confirmação de que nenhum SVG foi editado à mão (git diff --stat -- '*.svg').
  • Releitura manual completa para checar sentido e concordância.

Includes all 10 exercise subfolders. SVGs (before-prepend-append-after.svg,
insert-adjacent.svg) contain only method-name/keyword identifiers, so left
untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
let d = new Date(year, mon);

let table = '<table><tr><th>MO</th><th>TU</th><th>WE</th><th>TH</th><th>FR</th><th>SA</th><th>SU</th></tr><tr>';
let table = '<table><tr><th>SEG</th><th>TER</th><th>QUA</th><th>QUI</th><th>SEX</th><th>SAB</th><th>DOM</th></tr><tr>';

@gabifs gabifs Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sugestão: o cabeçalho de sábado está como SAB, sem o acento. A abreviação correta em português é SÁB, então o calendário renderizado na solução mostra a palavra com erro de grafia.

Suggested change
let table = '<table><tr><th>SEG</th><th>TER</th><th>QUA</th><th>QUI</th><th>SEX</th><th>SAB</th><th>DOM</th></tr><tr>';
let table = '<table><tr><th>SEG</th><th>TER</th><th>QUA</th><th>QUI</th><th>SEX</th><th>SÁB</th><th>DOM</th></tr><tr>';

# Crie uma árvore a partir do objeto

Write a function `createTree` that creates a nested `ul/li` list from the nested object.
Escreva uma função `createTree` que cria uma lista `ul/li` encadeada a partir do objeto encadeado.

@gabifs gabifs Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sugestão: "nested" foi traduzido como "encadeada/encadeado", que em programação costuma significar "chained" (o termo usado no tutorial para encadeamento de métodos e encadeamento opcional). Para estruturas uma dentro da outra, o termo usual é "aninhado". A mesma escolha aparece em 8-tree-count/task.md, linha 7 ("ul/li encadeados").

Suggested change
Escreva uma função `createTree` que cria uma lista `ul/li` encadeada a partir do objeto encadeado.
Escreva uma função `createTree` que cria uma lista `ul/li` aninhada a partir do objeto aninhado.

</ul>
</li>
<li>Trees
<li>Árvores

@gabifs gabifs Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observação (já existia no original em inglês, não bloqueia): o comentário com o resultado esperado mostra <li>Árvores (plural), mas a chave do objeto data logo abaixo é "Árvore" (singular). Quem comparar a própria saída com esse comentário vai notar a diferença. Que tal aproveitar e alinhar os dois?

Suggested change
<li>Árvores
<li>Árvore

Note que a chamada a `update()` não é apenas agendada em `clockStart()`, mas também executada imediatamente na linha `(*)`. Caso contrário, o visitante teria que esperar até a primeira execução do `setInterval`. E o relógio ficaria vazio até então.

Also it is important to set a new interval in `clockStart()` only when the clock is not running. Otherways clicking the start button several times would set multiple concurrent intervals. Even worse - we would only keep the `timerID` of the last interval, losing references to all others. Then we wouldn't be able to stop the clock ever again! Note that we need to clear the `timerID` when the clock is stopped in the line `(**)`, so that it can be started again by running `clockStart()`.
Também é importante definir um novo intervalo em `clockStart()` apenas quando o relógio não estiver em execução. Caso contrário, clicar no botão de início várias vezes definiria múltiplos intervalos simultâneos. Pior ainda - manteríamos apenas o `timerID` do último intervalo, perdendo as referências a todos os outros. Então nunca mais conseguiríamos parar o relógio! Note que precisamos limpar o `timerID` quando o relógio é parado na linha `(**)`, para que ele possa ser iniciado novamente ao executar `clockStart()`.

@gabifs gabifs Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observação (já existia no original em inglês, não bloqueia): o texto menciona timerID, mas a variável no código se chama timerId. Quem procurar ou copiar o nome não vai encontrá-lo. A mesma grafia timerID aparece nos comentários de 10-clock-setinterval/solution.view/index.html (no comentário de clockStart e no de timerId = null). Sugiro usar timerId em todos os lugares.

- Fix missing accent: "SAB" -> "SÁB" for Saturday's abbreviation
- Translate "nested" as "aninhado/aninhados" instead of "encadeado",
  which in PT-BR programming usage means "chained" (method chaining,
  optional chaining), not "nested inside"
- Align a comment showing expected output ("Árvores") with the
  singular data key ("Árvore") it refers to
- Use the actual variable name `timerId` consistently instead of the
  incorrect `timerID` in prose and comments

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@diogoosz

Copy link
Copy Markdown
Contributor Author

Obrigado pela revisão, @gabifs! Corrigido:

  • "SAB" com o acento correto, "SÁB"
  • "nested" traduzido como "aninhado(s)", não "encadeado(s)" (que sugere chaining)
  • Comentário alinhado com a chave singular "Árvore"
  • timerID corrigido pra timerId em todas as ocorrências

@gabifs gabifs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todas as sugestões foram aplicadas. Obrigado pela tradução, @diogoosz! 🎉

@gabifs
gabifs merged commit daead4d into javascript-tutorial:master Nov 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants